package org.xxpay.core.service;

import org.xxpay.core.entity.MchInfo;
import org.xxpay.core.entity.SysAttachment;

import java.util.List;
import java.util.Map;

/**
 * @author: dingzhiwei
 * @date: 17/9/8
 * @description:
 */
public interface IMchInfoService {

    /**
     * 新增成功返回mchId
     * @param mchInfo
     * @param attachments
     * @return
     */
    long add(MchInfo mchInfo, List<SysAttachment> attachments);

    /**
     * 新增成功 返回mchId
     * @param mchInfo
     * @param attachments
     * @return
     */
    long register(MchInfo mchInfo, List<SysAttachment> attachments);

    int update(MchInfo mchInfo);

    MchInfo find(MchInfo mchInfo);

    MchInfo findByMchId(Long mchId);

    MchInfo findByLoginName(String loginName);

    MchInfo findByMobile(Long mobile);

    MchInfo findByEmail(String email);

    MchInfo findByTag(String tag);

    MchInfo findByUserName(String userName);

    int auditOk(Long mchInd);

    int auditNot(Long mchInd);

    List<MchInfo> select(int offset, int limit, MchInfo mchInfo);

    List<MchInfo> select4Audit(int offset, int limit, MchInfo mchInfo);

    List<MchInfo> select4Normal(int offset, int limit, MchInfo mchInfo);

    Integer count(MchInfo mchInfo);

    Integer count4Audit(MchInfo mchInfo);

    Integer count4Normal(MchInfo mchInfo);

    Map count4Mch();

    /**
     * 重新设置商户信息
     * @param info
     */
    MchInfo reBuildMchInfoSettConfig(MchInfo info);


    int updateMchInfoAndAttachment(MchInfo info, List<SysAttachment> attachments);

    List<MchInfo> selectByExample2(int offset, int limit, MchInfo mchInfo);

    /** 删除商户及相关关联数据 **/
    int relationDelete(List<Long> ids);

    Map<String, String> selectNameMap();

}
